<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/cms/include/init_admin.jsp" %>
<%@ page import="com.qbooks.cms.admin.*" %>
<%

	HashList code009	= CommonUtil.getCodeList("009");	//권한
	HashList code015	= CommonUtil.getCodeList("015");	//판매자구분
	HashList codeUseYn	= CommonUtil.getCodeList("use_yn");	//사용여부
	
	String s_biz_gubn	= StringUtil.nvl(request.getParameter("s_biz_gubn"));
	String s_publisher_id		= StringUtil.nvl(request.getParameter("s_publisher_id"));
	String s_publisher_name	= StringUtil.nvl(request.getParameter("s_publisher_name"));
	String s_tel_no			= StringUtil.nvl(request.getParameter("s_tel_no"));

	HashMap infos = new HashMap();
	infos.put("biz_gubn", s_biz_gubn);
	infos.put("publisher_id", s_publisher_id);
	infos.put("publisher_name",	s_publisher_name);
	infos.put("tel_no",	s_tel_no);

	AdminDAO dao 	= new AdminDAO();
	HashList list 	= dao.selectPublisherList(infos);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %></title>
	<%@ include file="/cms/include/cssnjs.jsp"  %>
	<script type="text/javascript">
	$(document).ready(function() {
		$('#s_name').focus().select();
		$('#list').find('tr').hover(
				function () { $(this).addClass("hover"); }
			  , function () { $(this).removeClass("hover"); }
			)
			.click(function(){
				$('#publisher_id').val($(this).attr('publisher_id'));
				$('#searchForm').attr('action', './publisherDetail.jsp');
				$('#searchForm').submit();
			});
		$('#list').find('input, select').change(function() {
			$(this).closest('tr').find('input[name="list.job_type"]').val('U');
		});
	});


	function fnSave() {
		$("#saveForm").attr('action', './publisherSave.do');
		$("#saveForm").submit();
	}


	function fnNew() {
		$('#publisher_id').val('XXXXXX');
		$('#searchForm').attr('action', './publisherDetail.jsp?job_type=C');
		$('#searchForm').submit();
	}
	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/cms/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/cms/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>발행자관리</h1>
				<p>CMS > 관리자 > <b>발행자관리</b></p>
			</div>
			<div class="clear line_01"></div>

			<form id="searchForm" method="post" action="./publisherList.jsp">
			<input type="hidden" name="publisher_id" id="publisher_id" value=""/>
			<table cellpadding="0" cellspacing="0" class="table_01 mt15">
			<colgroup>
				<col width="100px" />
				<col width="160px" />
				<col width="100px" />
				<col width="160px" />
				<col width="100px" />
				<col  />
			</colgroup>
			<tr>
				<th><p>사업자구분</p></th>
				<td>
					<select name="s_biz_gubn" class="w120">
						<option value="">전체</option>
						<%= StringUtil.makeOption(code015, s_biz_gubn) %>
					</select>
				</td>
				<th><p>발행자아이디</p></th>
				<td>
					<input type="text" name="s_publisher_id" id="s_publisher_id" value="<%= s_publisher_id %>" class="w120"/>
				</td>
				<th><p>발행자명</p></th>
				<td>
					<input type="text" name="s_publisher_name" id="s_publisher_name" value="<%= s_publisher_name %>" class="w120"/>
				</td>
				<th><p>연락처</p></th>
				<td class="brx">
					<input type="text" name="s_tel_no" id="s_tel_no" value="<%= s_tel_no %>" class="w120"/>
				</td>
			</tr>
			</table>

			<div class="mt10 mb10 r">
				<input type="image" class="button" src="../images/btn_search.gif"/>
				<a href="#nohref" onclick="fnNew()"><img src="../images/btn_new.gif"/></a>
			</div>

			</form>




			<div class="search_result">검색결과 : <%= list.size() %>건</div>


		    <table cellpadding="0" cellspacing="0" class="table_03">
				<colgroup>
					<col width="40px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
					<col />
					<col width="100px"/>
					<col width="100px"/>
					<col width="100px"/>
				</colgroup>
				<thead>
					<tr>
						<th><p>No</p></th>
						<th><p>사업자구분</p></th>
						<th><p>아이디</p></th>
						<th><p>발행자명</p></th>
						<th><p>비밀번호</p></th>
						<th><p>이메일</p></th>
						<th><p>연락처</p></th>
						<th><p>사업자번호</p></th>
						<th><p>사용여부</p></th>
					</tr>
				</thead>
				<tbody id="list">
			<%	for (int i = 0; i < list.size(); i++) { %>
					<tr publisher_id="<%= list.get("publisher_id", i) %>">
						<td><%= i+1 %></td>
						<td><%= list.get("biz_gubn_name", i) %></td>
						<td><%= list.get("publisher_id", i) %></td>
						<td><%= list.get("publisher_name", i) %></td>
						<td><%= list.get("publisher_pw", i) %></td>
						<td><%= list.get("email", i) %></td>
						<td><%= list.get("hp_no", i) %></td>
						<td><%= list.get("biz_no", i) %></td>
						<td><%= list.get("use_yn", i) %></td>
					</tr>
			<%	} %>
				</tbody>
			</table>

		</div>
	</div>
</div>
</body>
</html>
